package main

import (
	"fmt"
	"runtime"
)

/**
让主协程让出时间片
 */
func main() {
	go func (){
		for i:=0;i<5;i++{
			fmt.Println("子协程任务执行。。。")
			//time.Sleep(time.Second)
		}
	}()
	for i:=0;i<5;i++{

		//time.Sleep(time.Second)
		fmt.Println("主协程任务执行。。。")
		runtime.Gosched()
	}
}
